var status = -1;
var selectionLog = [];

function start(d, c, b) {
    status++;
    var a = -1;
    if (status <= a++) {
        qm.dispose()
    } else {
        if (status === a++) {
            qm.updateInfoQuest(33132, "save=4;boss=noclear;board1=Noclear");
            qm.curNodeEventEnd(true);
            qm.setInGameDirectionMode(true, true, true);
            qm.inGameDirectionEvent_AskAnswerTime(1000)
        } else {
            if (status === a++) {
                qm.fieldEffect_KinesisEXP(Math.pow(qm.getLevel(), 3) / 4);
                qm.forceCompleteQuest(33146);
                qm.gainExp(Math.pow(qm.getLevel(), 3) / 4);
                qm.inGameDirectionEvent_AskAnswerTime(2000);
                qm.effect_Voice("Field.img/masteryBook/EnchantSuccess", 100)
            } else {
                if (status === a++) {
                    qm.addPopupSay(1540454, 1000, "变身术士被打倒了！\r\n你真了不起, 队长!", "", 0);
                    qm.addPopupSay(1540455, 1000, "敌人首领被我打败了!!!", "", 0);
                    qm.addPopupSay(1540456, 1000, "打败敌人首领的是队长!", "", 0);
                    qm.inGameDirectionEvent_AskAnswerTime(7000)
                } else {
                    if (status === a++) {
                        qm.onTeleport(0, 3, qm.getPlayer().getId(), -849, -163);
                        qm.inGameDirectionEvent_ForcedFlip(1);
                        qm.inGameDirectionEvent_AskAnswerTime(3000)
                    } else {
                        if (status === a++) {
                            qm.fieldEffect_PlayBGM("Bgm00.img/Silence", 0, 0);
                            qm.npc_ChangeController(1540443, "oid=22692748", -515, -151, 9, -565, -465, 1, false, 0, false);
                            qm.npc_SetSpecialAction("oid=22692748", "summon", 0, 0);
                            qm.npcMove(1540443, 500, 0, 0);
                            qm.inGameDirectionEvent_AskAnswerTime(100)
                        } else {
                            if (status === a++) {
                                qm.fieldEffect_PlayBGM("Bgm18.img/BlackWing", 0, 0);
                                qm.npcMove(1540443, -500, 0, 7000);
                                qm.inGameDirectionEvent_AskAnswerTime(3000)
                            } else {
                                if (status === a++) {
                                    qm.inGameDirectionEvent_MoveAction(2);
                                    qm.inGameDirectionEvent_AskAnswerTime(100)
                                } else {
                                    if (status === a++) {
                                        qm.inGameDirectionEvent_MoveAction(0);
                                        qm.inGameDirectionEvent_AskAnswerTime(4000);
                                        qm.effect_Voice("Voice3.img/BlackHeaven/carrier/1", 100)
                                    } else {
                                        if (status === a++) {
                                            qm.addPopupSay(1540455, 1000, "出, 出现了!那是黑色天堂!", "", 0);
                                            qm.inGameDirectionEvent_AskAnswerTime(4000);
                                            qm.effect_Voice("Voice3.img/BlackHeaven/3_dolfy/17", 100)
                                        } else {
                                            if (status === a++) {
                                                qm.addPopupSay(1013203, 1000, "你居然打倒了变身术士, \r\n真是了不起!\r\n不过, 你只能嚣张到这里了!", "", 0);
                                                qm.inGameDirectionEvent_AskAnswerTime(1500)
                                            } else {
                                                if (status === a++) {
                                                    qm.npc_SetSpecialAction("oid=22692748", "special", 0, 1);
                                                    qm.fieldEffect_PlayFieldSound("BlackHeaven/0", 100);
                                                    qm.inGameDirectionEvent_AskAnswerTime(3000)
                                                } else {
                                                    if (status === a++) {
                                                        qm.npc_LeaveField("oid=22692748");
                                                        qm.npc_LeaveField("oid=22692748");
                                                        qm.npc_ChangeController(1540600, "oid=22693553", -515, -151, 9, -565, -465, 1, false, 0, false);
                                                        qm.npc_SetSpecialAction("oid=22693553", "summon", 0, 0);
                                                        qm.fieldEffect_InsertCanvas11(0, 256, 0, 0, 0, 0);
                                                        qm.fieldEffect_InsertCanvas11(5, 0, 0, 0, 0, 0);
                                                        qm.inGameDirectionEvent_AskAnswerTime(50)
                                                    } else {
                                                        if (status === a++) {
                                                            qm.addPopupSay(1540455, 1000, "避开!跳跃!!", "", 0);
                                                            qm.inGameDirectionEvent_AskAnswerTime(150)
                                                        } else {
                                                            if (status === a++) {
                                                                qm.inGameDirectionEvent_AskAnswerTime(2000)
                                                            } else {
                                                                if (status === a++) {
                                                                    qm.inGameDirectionEvent_QTE(3)
                                                                } else {
                                                                    if (status === a++) {
                                                                        qm.inGameDirectionEvent_AskAnswerTime(500)
                                                                    } else {
                                                                        if (status === a++) {
                                                                            qm.npc_LeaveField("oid=22693553");
                                                                            qm.npc_LeaveField("oid=22693553");
                                                                            qm.npc_ChangeController(1540601, "oid=22693650", -515, -151, 9, -565, -465, 1, false, 0, false);
                                                                            qm.npc_SetSpecialAction("oid=22693650", "summon", 0, 0);
                                                                            qm.npc_SetSpecialAction("oid=22693650", "special", 0, 1);
                                                                            qm.fieldEffect_PlayFieldSound("BlackHeaven/1", 100);
                                                                            qm.inGameDirectionEvent_AskAnswerTime(150);
                                                                            qm.effect_Voice("Voice3.img/BlackHeaven/carrier/3", 100)
                                                                        } else {
                                                                            if (status === a++) {
                                                                                qm.fieldEffect_Tremble(0, 500, 30);
                                                                                qm.inGameDirectionEvent_AskAnswerTime(120)
                                                                            } else {
                                                                                if (status === a++) {
                                                                                    qm.fieldEffect_InsertCanvas11(0, 0, 0, 0, 0, 0);
                                                                                    qm.inGameDirectionEvent_MoveAction(7);
                                                                                    qm.inGameDirectionEvent_AskAnswerTime(2000)
                                                                                } else {
                                                                                    if (status === a++) {
                                                                                        qm.addPopupSay(1013203, 1000, "还不错嘛!", "", 0);
                                                                                        qm.npcMove(1540601, 500, 0, 3000);
                                                                                        qm.inGameDirectionEvent_AskAnswerTime(3000);
                                                                                        qm.effect_Voice("Voice3.img/BlackHeaven/carrier/4", 100)
                                                                                    } else {
                                                                                        if (status === a++) {
                                                                                            qm.npc_LeaveField("oid=22693650");
                                                                                            qm.npc_LeaveField("oid=22693650");
                                                                                            qm.addPopupSay(1540455, 1000, "很好!!进攻!", "", 0);
                                                                                            qm.inGameDirectionEvent_AskAnswerTime(3500)
                                                                                        } else {
                                                                                            if (status === a++) {
                                                                                                qm.setInGameDirectionMode(false, true, false);
                                                                                                qm.updateInfoQuest(33132, "save=4;boss=noclear;board1=clear");
                                                                                                qm.dispose();
                                                                                                qm.enableActions()
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
};